VB5 Control Creation Edition
AXButton ActiveX Control Sample
| Home | Site Map |

 

The button below is a control created by the Control Creation Edition of Visual Basic 5.0. The control is highlighted whenever the mouse moves over it. In addition, the image displayed is downloaded asynchronously by VB5. Use the control panel below to observe the events fired by the button, and to modify the image URL. A brief explanation of the code and control is available.

Picture URL
Event Monitor


The AXButton Control Explained

The AXButton control on this HTML page is scripted with VBScript code. The text below explains how the VBscript code manipulates the VB-created button.

The URLPicture Property
The image displayed by the button control is obtained from the URL specified in the button's URLPicture property. When this property is changed, the button control retrieves the new image and displays it. The code behind the Change URL button changes the URL property to what has been entered in the text box:

		
	Sub btnChange_onClick
		AXButton.URLPicture = txtPicURL.Value
	End Sub
The MouseDown, MouseUp, and MouseMove Events
The button control fires MouseUp, MouseDown, and MouseMove events. Each event is passed the same four arguments: This page places the last event in a text box, listing the parameters for the event:

		
	Sub AXButton_MouseDown(Button, Shift, X, Y)
		txtLastEvent.Value = "MouseDown(Button:= " & Button & ", Shift:= " & Shift & ", X:= " & X & ", Y:= " & Y & ")"
	End Sub

	Sub AXButton_MouseUp(Button, Shift, X, Y)
		txtLastEvent.Value = "MouseUp(Button:= " & Button & ", Shift:= " & Shift & ", X:= " & X & ", Y:=" & Y & ")"
	End Sub

	Sub AXButton_MouseMove(Button, Shift, X, Y)
		txtLastEvent.Value = "MouseMove(Button:= " & Button & ", Shift:= " & Shift & ", X:= " & X & ", Y:=" & Y & ")"
	End Sub